<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- ### 2. 整理出来以下会改变原数组的数组方法

1. push
2. pop
3. unshift
4. shift
5. sort
6. reverse
7. splice -->
    <script>
      // 7.splice
      // 数组.splice(index索引, 要删除的个数，要添加的东西)
      // 改变原数组
      // 返回值 ：一个新数组
      let arr = [1, 2, 3, 4, 5, 6]
      const arr1 = arr.splice(4, 3)
      console.log(arr1) //[5, 6]
    </script>
  </body>
</html>
